<?php
/**
 * Created by PhpStorm.
 * User: chniccs
 * Date: 2019-12-16
 * Time: 9:29
 */

namespace app\app\controller;


use app\constant\SuggestConst;
use app\model\AppSuggest;
use app\util\ReturnCode;

class Suggest extends Base
{
    public function save(){
        $post = $this->request->post();
        unset($post['tid']);
        unset($post['id']);
        unset($post['del']);
        unset($post['status']);
        $post['del'] = 0;
        $post['tid'] = $this->getUserTid();
        $post['uid'] = $this->userInfo['uid'];
        $post['status'] = SuggestConst::STATUS_UN_SOLVE;
        $done = AppSuggest::create($post);
        if($done){
            return $this->buildSuccess(null);
        }
        return $this->buildFailed(ReturnCode::FAILED,'保存失败');
    }


}